package com.ubao.ui.account;



import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ubao.R;




public class AccountView extends LinearLayout {

	private ImageView head;

	private TextView name;
	
	private ImageView rank;
	

	
	public AccountView(Context context) {
		super(context);
		init(context);
	}

	public AccountView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	private void init(Context context) {
		Resources resource = getResources();
//		this.setMeasuredDimension(RelativeLayout.LayoutParams.FILL_PARENT,
//				(int) resource.getDimension(R.dimen.titlebar_height));
		this.setGravity(Gravity.CENTER_VERTICAL);
		this.setWeightSum(1);
 
		// Inflate the view from the layout resource.
		String infService = Context.LAYOUT_INFLATER_SERVICE;
		LayoutInflater li = (LayoutInflater) context
				.getSystemService(infService);
		li.inflate(R.layout.widge_accountview, this);
		InitViews();
	}

	private void InitViews() {
		head = (ImageView) findViewById(R.id.ivHeadimg);
		name = (TextView) findViewById(R.id.tvName);
		rank = (ImageView) findViewById(R.id.ivRank);
	}
	
	public void setUserName(String name){
		this.name.setText(name);
	}
	
}
